home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************
-
- NUM
-
- This program will switch the num-lock setting.
-
- Usage:
- NUM or NUM ON turns on num-lock.
- NUM OFF turns it off.
-
- Written by Steven Stern, JMB Realty Corporation, November, 1986
-
- Compilation note for Mark Williams C: Requires the large model, i.e.,
- cc -vlarge num.c
-
- *************************************************************************/
-
- #include <ctype.h>
- main (argc, argv)
-
- char *argv[];
- int argc;
-
- {
- unsigned status_byte;
- int on = 0;
- int i;
-
- if (argc == 2)
- {
- for(i=0;argv[1][i]!='\0';i++) argv[1][i]=_toupper(argv[1][i]);
- if (strcmp("OFF",argv[1])==0) on=-1;
- }
-
- status_byte=peekb(0x417,0);
-
- if (on==0)
- status_byte=status_byte | 0x20;
- else
- if (status_byte & 0x20) status_byte=status_byte ^ 0x20;
-
- pokeb(0x417,0,status_byte);
- }